
ac.skill('Boss5-1'){
    cool = 8,
    title = '飓风追击',
    range = 1200,
    casttime = 0,
    model1 = [[BOSS5_jfzj.mdl]],
    on_cast_shot = function(self)
        local hero = self.owner
        ac.timer(250,10,function()
            hero:add_buff '技能蓄力'{time = 0.4,skill = self}
            local lock = {}
            local angle = math.random(360)
            local mover = ac.mover('line'){
                start = hero,
                model = self.model1,
                angle = angle,
                speed = 1200,
                distance = 1000,
                on_move = function(_,point)
                    if point then
                        local damage = hero:get('攻击') * 3
                        hero:aoe_damage(point,200,damage,self,lock)
                    end
                end,
                on_remove = function(mvr)
                    if mvr.effect then
                        mvr.effect:remove()
                    end
                end
            }
            mover.effect = ac.hint_line(hero,angle)
            mover:set_pause(true)
            ac.wait(200,function()
                mover:set_pause(false)
            end)
        end)
        ac.timer(2000,3,function()
            -- local group = ac.selector('unit'):range(hero,self.range):enemy(hero):is_type('英雄'):get()
            -- for _,unit in ipairs(group) do
            --     local lock = {}
            --     local mover = ac.mover('line'){
            --         start = hero,
            --         model = self.model1,
            --         angle = hero:get_facing(),
            --         speed = 1200,
            --         distance = 1000,
            --         on_move = function(_,point)
            --             if point then
            --                 local damage = hero:get('攻击') * 5
            --                 hero:aoe_damage(point,200,damage,self,lock)
            --             end
            --         end,
            --         on_remove = function(mvr)
            --             if mvr.effect then
            --                 mvr.effect:remove()
            --             end
            --         end
            --     }
            --     mover.effect = ac.hint_line(hero,angle)
            --     local time = 0.5
            --     local timer = ac.loop(30,function()
            --         local point1 = hero:get_point()
            --         local point2 = unit:get_point()
            --         mover.angle = point1 / point2
            --         mover.mover:set_facing(mover.angle)
            --         mover.effect:set_facing(mover.angle)
            --     end)
            --     mover:set_pause(true)
            --     ac.wait(time*1000,function()
            --         timer:remove()
            --         ac.wait(1000,function()
            --             mover:set_pause(false)
            --         end)
            --     end)
            -- end
            
        end)
    end,
}


ac.skill('Boss5-2'){
    title = '冰爆领域',
    range = 1200,
    cool = 8,
    casttime = 0,
    model1 = [[387.mdl]],
    on_cast_shot = function(self)
        local hero = self.owner
        ac.timer(1000,3,function()
            local time = 1
            
            local point = hero:get_point()
            local group = ac.selector('unit'):range(point,2000):enemy(hero):is_type('英雄'):get()
            local points = {}
            for _,unit in ipairs(group) do
                points[#points + 1] = unit:get_point()
            end

            for i = #points+1,20 do
                points[#points + 1] = point:random(2000)
            end

            local damage = hero:get('攻击') * 5
            hero:add_buff '技能蓄力'{time = time,skill = self}
            for _,pt in ipairs(points) do
                ac.hint_red(pt,200,time+0.7)
                ac.wait(time*1000,function()
                    pt:add_effect(self.model1):remove()
                    ac.wait(700,function()
                        hero:aoe_damage(pt,200,damage)
                    end)
                end)
            end
        end)
    end,
}

ac.skill('Boss5-3'){
    title = '冰封千里',
    targettype = '点',
    range = 1200,
    casttime = 0,
    model1 = [[BOSS5_bfql.mdl]],
    model2 = [[BOSS2_ldjtcf.mdl]],
    on_cast_shot = function(self)
        local hero = self.owner
        local point1 = hero:get_point()
        local point2 = self.target:get_point()
        ac.mover('line')
        {
            mover = hero,
            angle = point1/point2,
            speed = 2200,
            distance = point1*point2,
            on_move = function(_,point)
                if point then
                    local effect = hero:create_shadow(point,angle,0.2)
                    effect:play_animation('stand')
                    point:effect{
                        model = self.model2,
                        angle = angle,
                        time = 0.2,
                    }
                end
            end,
            on_remove = function()
                if hero:is_alive()==false then
                    return
                end
                local time = 2
                local pt = hero:get_point()
                local damage = hero:get('攻击') * 15
                hero:add_buff '技能蓄力'{time = time,skill = self}
                ac.hint_red(pt,800,time)
                ac.wait(time*1000,function()
                    pt:effect{
                        model = self.model1,
                        time = 1,
                    }
                    hero:aoe_damage(pt,800,damage)
                end)
            end
        }
    end,
}